<?php

class Widget extends BaseObject{
	private $__filename='';
	private $__destructcode='';
	
	public function __construct($name,$vars){
		$this->__filename=PATH_FFWD.'defaulttemplates/widgets/'.$name.'.php';
		if(!file_exists($this->__filename))throw new Exception('Widget not found: '.$name);
		foreach($vars as $k=>&$v)$this->data[$k]=&$v;
		include $this->__filename;
	}
	
	public function __destruct(){
		if($this->__destructcode)eval('?>'.$this->__destructcode);
	}







}